﻿Module Module1

    Sub Main()
        Console.Title = "Ejercicio bucles 2,3,4"
        Dim numSr, line As String
        Dim cont As Integer
        Dim suma As Decimal

        Do
            Console.Write("Introduzca un número ")
            numSr = Console.ReadLine()
           
            Do Until IsNumeric(numSr)
                Console.Write("No ha introducido un numero, Reintenta ")
                numSr = Console.ReadLine()
            Loop
            suma += Decimal.Parse(numSr)
            cont += 1

            Do
                Console.Write("Desea continuar S/N ")
                line = Console.ReadLine()
            Loop Until line = "n" Or line = "s"

        Loop Until line.ToUpper = "N"
        Console.WriteLine("La suma es " & suma)
        Console.WriteLine("La media es " & (suma / cont))
        Console.ReadKey()

    End Sub

End Module
